package cn.sytton.taffe.web.flw.service;

import cn.sytton.taffe.framework.base.entity.PageParam;
import cn.sytton.taffe.web.flw.entity.FlowTaskVariableEntity;
import cn.sytton.taffe.web.flw.entity.FormInstanceEntity;
import cn.sytton.taffe.framework.base.service.IBaseService;
import cn.sytton.taffe.web.flw.entity.FlowInstanceVariableEntity;
import cn.sytton.taffe.web.flw.listener.ProcessListenerEntity;
import com.github.pagehelper.PageInfo;

/**
 * <p>
 * 表单实例 服务类
 * </p>
 *
 * @author rock
 * @since 2023-09-27
 */
public interface IFormInstanceService extends IBaseService<FormInstanceEntity> {

    /**
     * 保存并启动流程
     * @param fiv
     */
    void start(FlowInstanceVariableEntity fiv);

    /**
     * 审批流程
     * @param ftv
     */
    void approve(FlowTaskVariableEntity ftv);

    /**
     * 监听流程回调
     * @param le
     */
    void flowListener(ProcessListenerEntity le);

    /**
     * 查询我申请的单据列表
     * @param pp
     * @return
     */
    PageInfo<FormInstanceEntity> findMyApplyPage(PageParam pp);

    /**
     * 查询我参与审批的单据列表
     * @param pp
     * @return
     */
    PageInfo<FormInstanceEntity> findMyApprovePage(PageParam pp);
}
